summary: add new command line arguments to sign the summary file
authorGiuseppe Scrivano <gscrivan@redhat.com>
Wed, 29 Apr 2015 09:43:17 +0000 (11:43 +0200)
committerGiuseppe Scrivano <gscrivan@redhat.com>
Thu, 7 May 2015 19:58:04 +0000 (21:58 +0200)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
doc/ostree-summary.xml
src/ostree/ot-builtin-summary.c

index f193be85447948bcce1e2e8d3e116f5eab2b6e8c..3fa287ebfe3c1a5dc2359e43162c47efaf4cac7b 100644 (file)
@@ -76,6 +76,23 @@ Boston, MA 02111-1307, USA.
                  Update the summary file.
                 </para></listitem>
             </varlistentry>
+
+            <varlistentry>
+                <term><option>--gpg-sign</option>=KEYID</term>
+
+                <listitem><para>
+                    GPG Key ID to sign the delta with.
+                </para></listitem>
+            </varlistentry>
+
+            <varlistentry>
+                <term><option>--gpg-homedir</option>=HOMEDIR</term>
+
+                <listitem><para>
+                    GPG Homedir to use when looking for keyrings.
+                </para></listitem>
+            </varlistentry>
+
         </variablelist>
     </refsect1>
 </refentry>
index ed167b7c6c9967f3393c1078bc26562bce0c4c40..4622ceef4cbe107a8f1ee1853af0da2dcb9848e5 100644 (file)
 #include "otutil.h"
 
 static gboolean opt_update;
+static char **opt_key_ids;
+static char *opt_gpg_homedir;
 
 static GOptionEntry options[] = {
   { "update", 'u', 0, G_OPTION_ARG_NONE, &opt_update, "Update the summary", NULL },
+  { "gpg-sign", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_key_ids, "GPG Key ID to sign the commit with", "KEY-ID"},
+  { "gpg-homedir", 0, 0, G_OPTION_ARG_STRING, &opt_gpg_homedir, "GPG Homedir to use when looking for keyrings", "HOMEDIR"},
   { NULL }
 };
 
@@ -51,6 +55,16 @@ ostree_builtin_summary (int argc, char **argv, GCancellable *cancellable, GError
 
       if (!ostree_repo_regenerate_summary (repo, NULL, cancellable, error))
         goto out;
+
+      if (opt_key_ids)
+        {
+          if (!ostree_repo_add_gpg_signature_summary (repo,
+                                                      (const gchar **) opt_key_ids,
+                                                      opt_gpg_homedir,
+                                                      cancellable,
+                                                      error))
+            goto out;
+        }
     }
   else
     {